<?php

defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
if($_RQ['op']=='main'){
	$taskid=intval($_RQ['taskid']);
	$timeid=intval($_RQ['timeid']);
	$roomid=intval($_RQ['roomid']);
	$get_goods=$this->model('model')->get_goods($taskid,$roomid,$timeid);
	/*$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$params=array('uniacid'=>$_SESSION['uniacid'],'timeid'=>$timeid,'roomid'=>$roomid,'taskid'=>$taskid);
    $fields='';
    $orderby='id desc';
	$total='';
	$goods=pdo_getslice('jy_yushou_task_goods',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	foreach($goods as &$v){
		$good=pdo_get('jy_weishop_goods',array('id'=>$v['goodsid']),array('title','image','price'));
		$v['image']=$good['image'];
		$v['timeid']=$v['timeid'].'点';
		$v['title']=$good['title'];
		$v['marketprice']=$good['price'];
		$v['seckillinfo'] = $this->model('model')->getSeckill($v['goodsid']);		
		$v['room']=pdo_getcolumn('jy_yushou_task_room',array('id'=>$v['roomid']),'title');
		$v['task']=pdo_getcolumn('jy_yushou_task',array('id'=>$v['taskid']),'title');
	}*/
	$return['list']=$get_goods['goods'];
	foreach($return['list'] as &$itemv){
			$itemv['carttotal']=pdo_getcolumn('jy_weishop_member_cart',array('goodsid'=>$itemv['goodsid'],'mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'total');
			$itemv['cartid']=pdo_getcolumn('jy_weishop_member_cart',array('goodsid'=>$itemv['goodsid'],'mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'id');
			$itemv['cartid']=$itemv['cartid']?:0;
			$itemv['carttotal']=$itemv['carttotal']?:0;
	}
	$return['roomid']=$roomid;	
	exi($return);
}